﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.LightSwitch;
using Microsoft.LightSwitch.Security.Server;
namespace LightSwitchApplication
{
    public partial class LSWDataService
    {
        partial void PaymentListByRef_PreprocessQuery(string RefID, ref IQueryable<PaymentList> query)
        {
            if (!string.IsNullOrEmpty(RefID))
            {
                query = query.Where(o => o.PaymentListDetails.Any(d=>d.RefID== RefID));
            }
        }

        partial void RecieptListByRef_PreprocessQuery(string RefID, ref IQueryable<RecieptList> query)
        {
            if (!string.IsNullOrEmpty(RefID))
            {
                query = query.Where(o => o.RecieptListDetails.Any(d => d.RefID == RefID));
            }
        }

        partial void QueryCashPayRec_PreprocessQuery(string Parameters, ref IQueryable<LightSwitchApplication.vrptCastPayRec> query)
        {
            query = LightSwitchFilter.Server.FilterExtensions.Filter(query, Parameters, this.Application);
        }

        partial void QueryPO_PreprocessQuery(string Parameter, ref IQueryable<rptPurchaseOrderJournal> query)
        {
            query = LightSwitchFilter.Server.FilterExtensions.Filter(query, Parameter, this.Application);
        }

        partial void QuerySO_PreprocessQuery(string Parameter, ref IQueryable<rptSalesOrderJournal> query)
        {
            query = LightSwitchFilter.Server.FilterExtensions.Filter(query, Parameter, this.Application);
        }

    }
}
